# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-neotime
pkgname=('python2-neotime' 'python-neotime')
_pkgname=neotime
pkgver=1.7.4
pkgrel=7
pkgdesc='Nanosecond resolution temporal types.'
arch=('any')
url='https://pypi.org/project/neotime/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b0fdcf9568ff449b323704c4948a56e9b7e2e06e6c58aabe6239810c8e634688e2321e46224eb4ea0b23c1d111ec2b44963615cd01e7d61b4de8d17abf168e04')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-neotime() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-neotime() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

